package jUnit;

import static org.junit.Assert.*;

import org.junit.Test;

public class SubscriptionTest {



	@Test
	public void testPricePerMonth() throws SubscriptionEndException {
		Subscription sub = new Subscription(200,2);
		assertTrue(sub.pricePerMonth() == 1.0) ;
	}

	@Test (expected = SubscriptionEndException.class)
	public void testCancel() throws SubscriptionEndException {
		Subscription sub = new Subscription(200,3);
		sub.cancel();
		assertTrue(sub.pricePerMonth() == 0 );
	}
	
	@Test
	public void testRound() throws SubscriptionEndException{
		Subscription sub = new Subscription(200,3);
		assertTrue(sub.pricePerMonth() == 0.67 );
	}

}
